﻿using System;
using System.Collections.Generic;
using System.Web.Security;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace ORS.Web
{
    public partial class Review : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (HttpContext.Current.Session["reviewerid"] == null)
            {
                FormsAuthentication.RedirectToLoginPage();
            }
            else
            {
                if (!IsPostBack)
                {
                    string uid = HttpContext.Current.Session["reviewerid"].ToString();
                    ORS.BLL.SearchName reviewtable = new ORS.BLL.SearchName();
                    string reviewer = reviewtable.getUsername(uid);
                    reviewgv.DataSource = reviewtable.getReviewDataSet(reviewer);
                    reviewgv.DataBind();
                }
            }
        }

        protected void reviewgv_RowDataBound(object sender, GridViewRowEventArgs e)
        {
            if (e.Row.RowType == DataControlRowType.DataRow)
            {
                //鼠标移动到每项时颜色交替效果
                e.Row.Attributes.Add("OnMouseOut", "this.style.backgroundColor='White';this.style.color='#003399'");
                e.Row.Attributes.Add("OnMouseOver", "this.style.backgroundColor='#6699FF';this.style.color='#8C4510'");



                ////单击/双击 事件
                //e.Row.Attributes.Add("OnDblClick","return reviewhandle('"+e.Row.Cells[1].Text+"')");
                e.Row.Attributes["ondblclick"] = String.Format("javascript:window.open('ReviewHandle.aspx?paperid={0}','FooterFrame');", e.Row.Cells[1].Text);
            }
        }           

    }
}